<template>
	<div class="ipPatent">
		<div class="ipPatent_form">
			<!-- 表格对应4个圆点 -->
			<div class="lineRadius l1"></div>
			<div class="lineRadius l2"></div>
			<div class="lineRadius r1"></div>
			<div class="lineRadius r2"></div>
			<table class="ntable">
			    	<tr>
			    		<th class="tx">商标名称</th> 
			    		<th width="20%" colspan="2">商标类型</th>
			     		<th colspan="">申请日 </th>
			     		<th colspan="">公开号</th>
			     		<th colspan="">公开日 </th>
			     	</tr> 
			     	<tr v-for="(item,index) in baseData" :key="index">
			     		<td rowspan="1" >{{item.brand_name}}</td> 
			     		<td colspan="2" class="left">{{item.brand_type}}</td>
			     		<td colspan="" class="">{{item.appl_date|dateParse}}</td>
			     		<td colspan="" class="">{{item.reg_code}}</td>
			     		<td colspan="" class="">{{item.reg_date}}</td>
			     	</tr>
			     </table>
		</div>
	</div>
</template>

<script>
	export default{
		name:'ipBrand',
		data() {
			return{
				sbcompany:'', //当前公司名
				baseData:[] //当前数据
			}
		},
		mounted() {
			this.getBasedata()
		},
		filters:{
			dateParse(dataString){
				/* 过滤器 */
			    if (dataString) {
			        let date = new Date(dataString);
			        let Y = date.getFullYear() + '-';
			        let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
			        let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
			        return Y + M + D ;
			    } else {
			        return '';
			    }
			}
		},
		methods:{
			// 获取当前数据
			async getBasedata(){
				this.sbcompany=this.$route.query.comname
				var dt = {
					"params": {
						"normGuid": "78fd1608-c19d-41d0-9abf-b36160dcae2e",
							"fieldList": [{
								"key":"company_name",
								"value":this.sbcompany
							}]
						}
				};
				const aaa = await this.$api.post('dcockpit/rest/cockpitApi/searchListNormResult', dt)
				let {custom:{result}}={...aaa}
				this.baseData=result.cockpitData
			},
			toNum(e){
				this.ipPatentNum=e
			}
		},
	}
</script>

<style lang="stylus" rel='stylesheet/stylus' scoped>
	@import "~@/assets/ipPatent.styl"
</style>
